<{include file="Public:header" /}>
<div id="page-wrapper">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header" style="margin-top: 0px;"></h1>
		</div>
		<!-- /.col-lg-12 -->
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>建筑管理</b>
				</div>
				<!-- /.panel-heading -->
				<div class="panel-body">
					<div class="dataTable_wrapper">
						<div id="dataTables-example_wrapper"
							class="dataTables_wrapper form-inline dt-bootstrap no-footer">
							<div class="row">

								<div class="col-sm-6">
									<form action="<{:Url('Place/building')}>" method="get">
										<div class="dataTables_filter" style="float: left;">
											<label>建筑名称: <input type="search" name="name"
												class="form-control input-sm" placeholder="">
											</label>
											<button class='btn btn-primary'>查询</button>
										</div>
									</form>
									<button class='btn btn-success'
										style="float: left; margin-left: 6px" onclick="addbuilding()">添加建筑</button>
								</div>
							</div>
							<div class="row">
								<div class="col-sm-12">
									<table id="yao_table"
										class="table table-striped table-bordered table-hover dataTable no-footer">
										<thead>
											<tr role="row">
												<th style="text-align: center;">用户名</th>
												<th style="text-align: center;">管理员类型</th>
												<th style="text-align: center;">操作</th>

											</tr>
										</thead>
										<tbody>
											<{volist name="lists" id='vo' }>
											<tr class="gradeA odd" role="row">
												<td style="text-align: center;"><{$vo.loginName}></td>
												<td style="text-align: center;"><{if
													condition="$vo['mark'] eq 1"}> <span style="color: red">超级管理员</span>
													<{else/}> 管理员 <{/if}>
												</td> <{if condition="$vo['mark'] neq 1"}>
												<td><a class="eduitbuilding"
													href="<{:url('account/rules')}>?id=<{$vo.id}>">分配权限</a> | <a
													class="deletebuilding" href="javascript:void(0)"
													onclick="deleteadmin('<{$vo.id}>')">删除</a></td> <{else/}>
												<td><span style="color: red">超级管理员不可操作</span></td> <{/if}>
											</tr>
											<{/volist}>

										</tbody>
									</table>
								</div>
							</div>

							<div class="row">
								<div class="col-sm-12">
									<div class='pages'><{$lists->render()}></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- /.panel-body -->
			</div>
			<!-- /.panel -->
		</div>
		<!-- /.col-lg-12 -->
	</div>

</div>
<script src="__PUBLIC__/js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/bui.js"></script>
<script type="text/javascript">
	var Overlay = BUI.Overlay;

	function deleteadmin(id) {
		BUI.Message.Confirm('确认要删除？', function() {
			setTimeout(function() {
				$.ajax({
					type : 'post',
					url : '<{:Url("Account/ajaxdeleteadnin")}>',
					data : {
						'id' : id
					},
					dataType : 'json',
					success : function(msg) {
						if (msg.status == 'success') {
							dispoint("删除成功！");
							location.reload();
						} else {
							dispoint("删除失败！");
						}

					}
				});

				//BUI.Message.Alert('这只是简单的错误信息','error');
			});

		}, 'question');
	}
</script>

<!-- 删除用户 -->
<script type="text/javascript">
	//消息消失
	function dispoint(messge) {
		BUI.Message.Show({
			msg : messge,
			icon : 'success',
			buttons : [],
			autoHide : true,
			autoHideDelay : 1000

		});
	}
</script>
<include file="Public:footer" />